﻿using KINLO.Model.MES;
using KINLO.UI.Main.MES;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace KINLO.UI.Main.Hepler
{
    public class MESEquipmentStatuLogData : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;
        public ObservableCollection<MESEquipmentStatuLogDataModel> DataList { get; set; } = new ObservableCollection<MESEquipmentStatuLogDataModel>();

        public MESEquipmentStatuLogData()
        {
            DataList.CollectionChanged += QueueList_CollectionChanged;
        }

        private void QueueList_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            CFGLoader.Save(this);
        }
        public void Load()
        {
            this.DataList = CFGLoader.Load<MESEquipmentStatuLogData>()?.DataList;
        }
    }
}
